<?php

/**
 * GameAccessory filter form base class.
 *
 * @package    aiontoolskit
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseGameAccessoryFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'item_type'        => new sfWidgetFormChoice(array('choices' => array('' => '', 'abyss' => 'abyss', 'draconic' => 'draconic', 'normal' => 'normal'))),
      'icon_name'        => new sfWidgetFormFilterInput(),
      'equipment_slots'  => new sfWidgetFormChoice(array('choices' => array('' => '', 'neck' => 'neck', 'right_or_left_ear' => 'right_or_left_ear', 'right_or_left_finger' => 'right_or_left_finger', 'waist' => 'waist'))),
      'quality_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameItemQuality'), 'add_empty' => true)),
      'level'            => new sfWidgetFormFilterInput(),
      'gender_permitted' => new sfWidgetFormChoice(array('choices' => array('' => '', 'all' => 'all', 'female' => 'female', 'male' => 'male'))),
      'bonus_apply'      => new sfWidgetFormChoice(array('choices' => array('' => '', 'equip' => 'equip', 'inventory' => 'inventory'))),
      'faction_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameFaction'), 'add_empty' => true)),
      'bonus_attr1'      => new sfWidgetFormFilterInput(),
      'bonus_attr2'      => new sfWidgetFormFilterInput(),
      'bonus_attr3'      => new sfWidgetFormFilterInput(),
      'bonus_attr4'      => new sfWidgetFormFilterInput(),
      'bonus_attr5'      => new sfWidgetFormFilterInput(),
      'bonus_attr6'      => new sfWidgetFormFilterInput(),
      'bonus_attr7'      => new sfWidgetFormFilterInput(),
      'bonus_attr8'      => new sfWidgetFormFilterInput(),
      'bonus_attr9'      => new sfWidgetFormFilterInput(),
      'bonus_attr10'     => new sfWidgetFormFilterInput(),
      'bonus_attr11'     => new sfWidgetFormFilterInput(),
      'bonus_attr12'     => new sfWidgetFormFilterInput(),
      'magical_resist'   => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'item_type'        => new sfValidatorChoice(array('required' => false, 'choices' => array('abyss' => 'abyss', 'draconic' => 'draconic', 'normal' => 'normal'))),
      'icon_name'        => new sfValidatorPass(array('required' => false)),
      'equipment_slots'  => new sfValidatorChoice(array('required' => false, 'choices' => array('neck' => 'neck', 'right_or_left_ear' => 'right_or_left_ear', 'right_or_left_finger' => 'right_or_left_finger', 'waist' => 'waist'))),
      'quality_id'       => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameItemQuality'), 'column' => 'id')),
      'level'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'gender_permitted' => new sfValidatorChoice(array('required' => false, 'choices' => array('all' => 'all', 'female' => 'female', 'male' => 'male'))),
      'bonus_apply'      => new sfValidatorChoice(array('required' => false, 'choices' => array('equip' => 'equip', 'inventory' => 'inventory'))),
      'faction_id'       => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameFaction'), 'column' => 'id')),
      'bonus_attr1'      => new sfValidatorPass(array('required' => false)),
      'bonus_attr2'      => new sfValidatorPass(array('required' => false)),
      'bonus_attr3'      => new sfValidatorPass(array('required' => false)),
      'bonus_attr4'      => new sfValidatorPass(array('required' => false)),
      'bonus_attr5'      => new sfValidatorPass(array('required' => false)),
      'bonus_attr6'      => new sfValidatorPass(array('required' => false)),
      'bonus_attr7'      => new sfValidatorPass(array('required' => false)),
      'bonus_attr8'      => new sfValidatorPass(array('required' => false)),
      'bonus_attr9'      => new sfValidatorPass(array('required' => false)),
      'bonus_attr10'     => new sfValidatorPass(array('required' => false)),
      'bonus_attr11'     => new sfValidatorPass(array('required' => false)),
      'bonus_attr12'     => new sfValidatorPass(array('required' => false)),
      'magical_resist'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('game_accessory_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'GameAccessory';
  }

  public function getFields()
  {
    return array(
      'id'               => 'Number',
      'item_type'        => 'Enum',
      'icon_name'        => 'Text',
      'equipment_slots'  => 'Enum',
      'quality_id'       => 'ForeignKey',
      'level'            => 'Number',
      'gender_permitted' => 'Enum',
      'bonus_apply'      => 'Enum',
      'faction_id'       => 'ForeignKey',
      'bonus_attr1'      => 'Text',
      'bonus_attr2'      => 'Text',
      'bonus_attr3'      => 'Text',
      'bonus_attr4'      => 'Text',
      'bonus_attr5'      => 'Text',
      'bonus_attr6'      => 'Text',
      'bonus_attr7'      => 'Text',
      'bonus_attr8'      => 'Text',
      'bonus_attr9'      => 'Text',
      'bonus_attr10'     => 'Text',
      'bonus_attr11'     => 'Text',
      'bonus_attr12'     => 'Text',
      'magical_resist'   => 'Number',
    );
  }
}
